package com.huiying.mapper;

import com.huiying.entity.entity.Image;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: lsh
 * @Date: 2024/11/17/17:21
 * @Description: 图片表的数据访问类
 */
@Mapper
public interface ImageMapper {
    void addContentImages(List<Image> imageList);

    @Select("select image_url from images where demand_id = #{demandId}")
    List<String> getUrlByDemandId(Long demandId);


    @Delete("delete from images where demand_id = #{demandId}")
    void deleteByDemandId(Long demandId);

    @Delete("delete from images where work_id = #{workId}")
    void deleteByWorkId(Long workId);
}
